<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>16.布局⼩⽶移动端⻚⾯结构</title>
  <style>
    * {
      padding: 0;
      margin: 0;
    }

    body {
      display: flex;
      flex-direction: column;
      height: 100vh;
      /*没有高度，不能撑开布局，所以要给一个100vh 占满屏幕高度*/
      justify-content: space-between;
    }

    header {
      height: 60px;
      background: blueviolet;
    }

    main {
      /*没有高度不能撑满中间的部分，所以 flex-grow :  1 将剩余高度都分配给它*/
      background: #ccc;
      flex-grow: 1;
    }

    footer {
      height: 60px;
      background: #388238;
    }
  </style>
</head>

<body>
  <header></header>
  <main></main>
  <footer></footer>
</body>

</html>